<template>
  <div class="flights_history">
    <div class="service">
      <div class="service_top">
        <div>
          <span class="iconfont iconweibiaoti-_huabanfuben"></span>
          <i>航协认真</i>
        </div>
        <div>
          <span class="iconfont iconbaozheng"></span>
          <i>出行保证</i>
        </div>
        <div>
          <span class="iconfont icondianhua"></span>
          <i>7×24</i>
        </div>
      </div>
      <div class="service_bottom">
        <p>免费客服电话：4006345678转2</p>
      </div>
    </div>

    <div class="history_select">
      <h3>历史查询</h3>

      <ul>
        <li v-for="(item,index) of $store.state.history.list" :key="index">
          <div>
            <span>{{item.departCity + ' - ' + item.destCity}}</span>
            <p>{{item.departDate}}</p>
          </div>
          <el-button type="warning" @click="historyClick(item)">选择</el-button>
        </li>
      </ul>
    </div>
    <!-- <ul>
      <li v-for="(item,index) of $store.state.history.list" :key="index">
        {{item.departCity}}
        {{item.dsepartCode}}
        {{item.destCity}}
        {{item.destCode}}
        {{item.departDate}}
      </li>
    </ul>-->
  </div>
</template>

<script>
export default {
  methods: {
    historyClick(item){
      // console.log('item: ', item);
      this.$emit('historyClick',item)
    }
  },
};
</script>


<style lang="less" scoped>
.flights_history {
  margin: 20px;
  width: 240px;
}
.service {
  height: 118px;
  border: 1px solid #ccc;
  position: relative;
  .service_top {
    height: 84px;
    display: flex;
    justify-content: space-around;
    > div {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      span {
        font-size: 40px;
      }
      i {
        font-size: 12px;
      }
      .iconweibiaoti-_huabanfuben {
        color: #59a9ff;
      }
      .iconbaozheng {
        color: #39aace;
      }
      .icondianhua {
        color: #409eff;
      }
    }
  }
  .service_bottom {
    width: 100%;
    text-align: center;
    font-size: 14px;
    height: 32px;
    line-height: 32px;
    background: #f6f6f6;
    position: absolute;
    bottom: 0;
  }
}
// 历史查询
.history_select {
  border: 1px solid #ccc;
  margin-top: 30px;
  padding: 8px;
  h3 {
    font-weight: 400;
    font-size: 16px;
    height: 38px;
    line-height: 38px;
    border-bottom: 1px solid #ccc;
  }
  ul {
    li {
      padding: 20px 0;
      list-style: none;
      display: flex;
      justify-content: space-between;
      align-items: center;
      span {
        font-size: 14px;
      }
      p {
        margin-top: 6px;
        font-size: 12px;
      }
      // 选择按钮
      /deep/ .el-button {
        width: 44px;
        height: 20px;
        padding: 0;
        font-size: 12px;
        cursor: pointer;
      }
    }
  }
}
</style>